#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	int k = n;
	int temp = 0;
	int ret = 0;
	int cnt = 0;
	while (k)
	{
		temp = k % 10;//123
		k /= 10;
		ret = ret * 10 + temp;
		cnt++;
	}
	n /= 10;
	long long int m = n * pow(10, cnt) + ret;
	int i = 0, flag = 0;
	for (i = 2; i <= sqrt(m); i++)
	{
		if (m % i == 0)
		{
			flag = 1;
			printf("noprime");
			return 0;
		}
	}
	printf("prime");
	return 0;
}